Call fatal if no Garmin USB devices found on USB scan. (Otherwise, we core
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 22 Feb 2005 07:43:26 +0000 (07:43 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 22 Feb 2005 07:43:26 +0000 (07:43 +0000)
later.)

gpsbabel/jeeps/gpslibusb.c

index 7e3f49b2e987cd1af95bbc79fc7c348e820acb75..fb90ce8c535462823c2ce3fadf9ca94af2ad64d3 100644 (file)
@@ -219,6 +219,7 @@ return;
 static
 void garmin_usb_scan(void)
 {
+       int initted = 0;
        struct usb_bus *bus;
 
        for (bus = busses; bus; bus = bus->next) {
@@ -230,10 +231,15 @@ void garmin_usb_scan(void)
                         * we just take the easy way out for now.
                         */
                        if (dev->descriptor.idVendor == GARMIN_VID) {
-                               garmin_usb_start(dev);
+                               garmin_usb_start(dev);  
+                               initted++;
                        }
                }
        }
+
+       if (0 == initted) {
+               fatal("Found no Garmin USB devices.\n");
+       }
 }
 
 #endif /* !defined(NO_USB) */